// Notice
//  
// The contents of this file are subject to the
//  same license as the source code for ImageJ.  FracLac is in the public domain.  
// If you use it to publish research, please cite the source.
// The initial developer of the original
// code is Audrey Karperien, Charles Sturt University.
package fraclac.FLAnalyzer;
 
import ij.ImagePlus;



/**Holds the variables for running FracLac.
 *
 * <p><b>IDE</b>: NetBeans IDE 4.1</p>
 * @version June 2005
 * @version 2.3
 * @author Audrey Karperien  (akarpe01@postoffice.csu.edu.au)
 * @since 1.5.0_03
 */
 public class FLVars  {
    //======================================================================//
    public int ChooseBackground=0;
    
    
    
        
        private String [] boxcountheadings=               
        {
        "FracLac v2.3 2005",
                 "Foreground pixels",
                 "Total pixels",
                 "Mean DB",
                 "r^2",
                 "SE",
                 "CV for DB",
                 "MEAN DB w/o intervals",
                 "r^2",
                 "SE",
                 "MIN COVER DB",
                 "r^2",
                 "SE",
                 "MIN DB w/o intervals",
                 "r^2",
                 "SE",
                 "Mean Y-Int",
                 "Mean Y-Int Lacunarity",
                 "CV for Y-Int",
                 "Mean Binned Probability Density Lacunarity",
                 "Mean CV for BPDL",
                 "Lacunarity: Mean CV^2 for Pixels Per Box",
                 "CV for Mean CV^2",
                 "Mean Lacunarity with empties",
                 "Mean Probability Lacunarity",
                 "Mean Probability Lacunarity with empties",
                 "Mean Empties CV",
                 "Mean Counts CV",
                 "CV Occupied/CV Unoccupied",
                 
                
                
                 
                 
                
                 //"Maximum V or H Span",
               
                
              
                
                
                "NUM BOXES",
                 "adjusted NUM BOXES",
                "Number of origins",
                "Maximum box size",
                 "Minimum box size",
                 "Density (pixels per area)",
                 "Span Ratio (major/minor axis)",// "ConvexHull and Bounding Circle",
                "Hull's Centre of Mass",
                "Maximum Span Across Hull",
                "Area",         
                "Perimeter",         
                "Circularity",
                "Width of Bounding Rectangle",
                "Height of Bounding Rectangle",         
                "Maximum Radius from Hull's Centre of Mass",
                "Max/Min Radii",
                "CV for all Radii",        
                "Mean Radius",
                "Circle's Centre",
                "Diameter of Bounding Circle",
                "Maximum Radius from Circle's Centre",
                "Max/Min Radii from Circle's Centre",
                "CV for all Radii from Circle's Centre",  
                "Mean Radius from Circle's Centre",
                "Method Used to Calculate Circle",
                
                   "Optimized Multifractal Location",
                 "CV for DQvsQ",
                 "slope for DQvsQ",
                 "r^2 for DQvsQ"

                 
                };
    public String BoxCountHeadings=MakeHeadings(boxcountheadings);
   
    /*private String [] lacheadings = {
             "Box Size",
                     "Epsilon",
                     "MEAN pixels per box tethered to foreground",
                     "STD DEV",
                     "Number of Boxes",
                     "LACUNARITY I (CV^2) ",
                     "MEAN pixels per box in image space",
                     "STD DEV",
                     "Number of Boxes",
                     "LACUNARITY II (CV^2)",
                     "LACUNARITY III (CV^2 + 1)",
                     "LACUNARITY IV (CV^2 + 1)"};*/
                     
  
 /* private String [] rawdataheadings = 
  {"Raw Data for Roi and Grid ",
                     
                     "FRACTAL DIMENSION (slope of Regression Line)",
                     "CORRELATION COEFFICIENT (R-squared) for Regression Line",
                     "STANDARD ERROR for Regression Line",
                     "Y-intercept for Regression Line",
                     
                     "FRACTAL DIMENSION without horizontal intervals",
                     "CORRELATION COEFFICIENT without horizontal intervals",
                     "STANDARD ERROR without horizontal intervals",
                     
                     "binned Mean Prob Density LACUNARITY",
                     "CV in binned Prob Density Lacunarity",
                     
                     "Mean Squared CV FOR PIXELS PER BOX",
                     "Mean Lacunarity with empties",
                     "Mean Probability Lacunarity",
                     "Mean Probability Lacunarity with empties",
                     
                     "CV for NUMBER OF EMPTY BOXES" ,
                     "CV FOR NUMBER OF NONEMPTY BOXES"  ,
                     "CV FOR NONEMPTY/EMPTY BOXES"};*/
  
  
    ///////////////////////////////////////////////////////////////////////
    //      PARAMETERS FOR Q VALUES FOR CALCUATING GENERALIZED DIMENSION
    //      AND MULTIFRACTAL SPECTRUM.
    public String data="";
    private float qmin = -10.00f;        //minimum and maximum exponents in range
    private float qmax = 10.00f;        //used for calculating
    private float qinc = 0.25f;          //the generalized dimension
    public int dataoption = 0;
    /**Array of values to calculate the generalized dimension over.*/
    public float [] Qs = null;
    
    //private boolean DRAWHull=false;
    //private boolean DRAWCircle=false;
    
    
     
    public boolean isVerticalLine=false, isHorizontalLine=false;
    public float LesserOfRectangleHeightAndWidth,
            GreaterOfRectangleHeightAndWidth, GreaterHorizontalOrVerticalDimension;
    
    
    public String OriginalImageTitle=" ";
    
    public int CVRadii = 0;
    public int MeanRadii = 0;
    public int MaxRadius = 0;
    public int MaxOverMinRadii = 0;
    
    public int PixelRatio = 1;
    
    public static int USEDEFAULT=0, USEBLACK=1, USEWHITE=2, BLACK=0, WHITE=255;
    
    /**Value of pixels that will be assessed.  Is
     *determined in {@link FLAnalyzer.FLMain#ready}.*/
    public int foreground=BLACK, background=WHITE;
    /**Size of border to add around images.*/
    public int border = 0;
    public float ScaledMaxBoxSize=0;
    public boolean UseGreater=true;//use the greater of the rois dimensions to calculate box sizes
    //private boolean MFUseGreater=true;
    private int TypeOfBoxSizeSeries=2;
    private int MFTypeOfBoxSizeSeries=2;
    
    
    final private static int POWERSERIES=1, SCALEDSERIES=2;
    public int MaxFrequencies = 40;
    public int TotalForegroundPixels = 1;
	public int TotalAllPixels=0;
	
    /**For ensuring a sufficient ratio of pixels to
     * background for random {@link FLAnalyzer.FLMain#runSubs subsamples}.
     * Default = 0.01*/
    private float FACTOR=0.01f;
    
    
    public int xOffset;
	public int yOffset;
    public int StartX;
	public int EndX;
	public int StartY;
	public int EndY;
     
   
    ///////////////////////////////////////////////////////////////////////
    //      VARIABLES DEFINING THE BOX SIZES USED
    /**
     * Unaccessible variable for the
     * lowest permitted number of boxes in a series.
     * @see FLAnalyzer.FLMain#MakeNewBoxSizes sizing method
     */
    public int leastpossibleboxes=5;
    public boolean ScaleTheBoxSizes=true;
    public float BoxSizeScaleNumerator=1;
    public float BoxSizeScaleDenominator=3;

    /**
     * Unaccessible variable that is
     * the most box sizes that can be used in a scan.
     */
    public int absolutemaximumnumberofboxes=500;

    /**
     * Integer that limits the number of box sizes to use.  Is
     * set in the {@link FLAnalyzer.FLMain#MakeNewBoxSizes box size limit setting method}.
     */
    public int limit = 4;
    
    
    
    
    
    
    
    
    
    
    
    ///////////////////////////////////////////////////////////////////////
    //      VARIABLES FOR GATHERING BOX COUNT RESULTS.  These hold
    //      the statistics per box size.
   // int[]  histogram;
    public int [][] Globalxy=null;
    private boolean quick=true;//true does not check the box size
    
    
    
    

    
    /**Coordinates marking where a grid started.*/
    public int actualx = 0;
    private int actualy = 0;
    public int actualbot = 0;
    public int actualrt=0;
    
    
    
    public boolean didMassHeadings = false;
    

    
        
    
    ///////////////////////////////////////////////////////////////////////
    //      IMAGE STUFF
    /**
     * Is reused for each image processed. 
     * @see FLAnalyzer.FLMain#measureHullandCircle
     * @see #dosubs
     */
    public ImagePlus originaldrawing;
    
public ImagePlus expandeddrawing;
    
    
    /////////////////////////////////////////////////////////////
    //////////////  VARIABLES SET BY GETINPUTS METHOD   /////////
    /////////////////////////////////////////////////////////////
    
    /**
     * User set variable for the minimum box size. Default = 1
     * @see FLAnalyzer.FLMain#MakeNewBoxSizes
     */
    public int BoxCountUserMinBoxSize=1;
    public int BoxCountUserMaxBoxSize=0;
    public int LacUserMinBoxSize=5;
    public int LacUserMaxBoxSize=0;
    public int MFUserMinBoxSize=10;
    public int MFUserMaxBoxSize=0;
    public int MinBoxSize=1;
    
    /**
     * Number of times to do an entire series of grids (i.e.,
     * if multiple origins are being used).  If set to 1,
     * only one scan is done for each &epsilon;, where each scan
     * at a different grid
     * size starts at the same location.  
     * If the value is more than 1, the series
     * of grid sizes is restarted several times from a different location.
     * A special case is seen with 
     * {@link #NumberOfGridsForMultiFractalAnalysis multifractal scans}.
     * Subscans cannot
     * use more than one location.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public int NumberOfGridPositions = 4;
    
    /**
     * The number of grid positions used in the multifractal analysis
     * as set in the 
     * {@link FLAnalyzer.FLsetup#getMFInputs get multifractal inputs} method,
     * to temporarily supersede {@link #NumberOfGridPositions}.
     * The default is 4; these first four values are different than
     * in the regular analysis.  The position changes only if a
     * {@link FLAnalyzer.FLMain#moveGridalloverCountPixels multifractal}
     * analysis is being done.  The change orients the grid so that it falls
     * completely at each of the four corners of the rectangle encompassing
     * the image. This emulates rotating the image 90&deg;
     * to all four positions,
     * whereas the usual shift is a translation. For calculations of
     * the positions, see 
     * {@link FLAnalyzer.FLMain#moveGridalloverCountPixels moving} function.
     * @see #BottomRight
     */
    private int NumberOfGridsForMultiFractalAnalysis = 4;
    
    
    
    /**
     * Maximum number of box sizes to use in a series.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}. Default is 0.
     * @see FLAnalyzer.FLMain#MakeNewBoxSizes
     * @see #MaximumRegularBoxCountBoxes
     *@see #MaximumSLACBoxSizes
     
     */
    public int MaximumMFBoxSizes = 20;
    /**
     * Maximum number of box sizes to use in a series.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}. Default is 0.
     * @see FLAnalyzer.FLMain#MakeNewBoxSizes
    
     *@see #MaximumSLACBoxSizes
     *@see #MaximumMFBoxSizes
     */
    public int MaximumRegularBoxCountBoxes = 0;
    /**
     * Size of boxes to use if doing subareas. Is set by
     *{@link FLAnalyzer.FLsetup#getInputs}.
     *@see #MaximumRegularBoxCountBoxes
    
     *@see #MaximumMFBoxSizes
     */
    public int MaximumSLACBoxSizes = 10;
  
    public int Subboxsize = 40;
    
    /**
     * Maximum percent of subbox to use as a
     * box size.  Is {@link FLAnalyzer.FLMain#MakeNewBoxSizes applied}
     * when doing {@link FLAnalyzer.FLMain#runSubs subareas}.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public float percentsubboxsize = 100;
    
    /**
     * True switches execution to calculate the lacunarity
     * using a 
     * {@link FLAnalyzer.FLMain#PrintSLIDINGLACUNARITY sliding box}
     * algorithm and also turns off the regular
     * box counting and multifractal scans.
     */
    public boolean SLAC=false;
    
    /**
     * Value by which to slide the sliding box in
     * {@link FLAnalyzer.FLMain#PrintSLIDINGLACUNARITY sliding lacunarity} 
     * method.
     **/
    public int SLIDEX = 5;
    
    /**
     * Value by which to slide the sliding box in
     * {@link FLAnalyzer.FLMain#PrintSLIDINGLACUNARITY sliding lacunarity} 
     * method.
     **/
    public int  SLIDEY=5;
    
    /**
     * True shows graphs of regression lines. 
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    private boolean GraphQs=false;
     
    /**
     * True moves each grid randomly at each &epsilon;, which is an
     * additional shift to the shift at the beginning of each
     * series of &epsilon;s.  The effect is that in a scan, each new box size
     * does not start at the same position as the previous. This variable is
     * used in the
     * {@link FLAnalyzer.FLMain#moveGridalloverCountPixels the scanning} 
     * function.
     */
    public boolean slipGrid=false;
    public boolean abort=true;
    
    /**Variable for composite type.  Default is 5*/
    private int comptype = 5;
    /**True specifies whether or not to use the ImageJ particle analyzer.
     *Is set in the @link getInputs method.  
     * Only applies when doing subareas.*/
    private boolean UseParticleAnalyzer = false;
    /**
     * Boolean that if true triggers a change in how the grid
     * is positioned for a multifractal analysis.  That is, for the
     * first four scans in a multifractal analysis using multiple origins,
     * the
     * grid is anchored at each of the four corners of the pixelated
     * area's enclosing rectangle, instead of at the top left as
     * is done with the standard count.  This is akin to rotating 90&deg;
     * each time, as opposed to translating some random amount.
     *
     * @see #NumberOfGridsForMultiFractalAnalysis
     * @see FLAnalyzer.FLMain#moveGridalloverCountPixels moving method
     */
    public boolean BottomRight=true;
    
    /**
     * Maximum percent of image area to use as
     * box size.  Is {@link FLAnalyzer.FLMain#MakeNewBoxSizes applied}
     * to the smallest
     * {@link FLAnalyzer.FLMain#RectangleEnclosingForeground rectangle}
     * enclosing the pixelated part of the image.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public float maxpercent=100;
    public boolean power=false;
    private float mfmaxpercent=100; //, standardmaxpercent=45;
    public float base=2.0f;
    public float exponent=1.0f;
    /**
     * Maximum percent of image area to use as
     * sub box size for sub scans.  Based on smallest rectangle
     * enclosing the pixelated part of the image.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs} and used in the
     * {@link FLAnalyzer.FLMain#MakeNewBoxSizes box making} method.
     */
    public float maxsubpercent=0f;
    
    /**
     * True finds
     * fractal dimensions over several subareas
     * of the image to reveal differences in the
     * distribution of complexity at different sampling sizes.
     * False finds one over only
     * the entire area. Is set by {@link FLAnalyzer.FLsetup#getInputs}
     * to be used in the {@link FLAnalyzer.FLMain#runSubs subsampling method}.
     */
    public boolean dosubs = false;
    
    /**
     * True runs automatic thresholding. 
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public boolean thresh = true;
    
    /**
     * Number of {@link FLAnalyzer.FLMain#runSubs subareas}
     * to analyze if doing a random sample.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    private int subsamples = 3;
    
    /**
     * True prints summary data, and false prints the
     *  {@link FLMain#printRawData raw data}
     * , including the mass information.  The
     * mass data (mean pixels per box at each &epsilon;)
     * can be used to find the fractal dimension, as the
     * slope of the regression line of the
     * ln-ln plot of mean and &epsilon; (see
     * {@link FLAnalyzer.FLMain#FinishQslopesForAllEpsilonAtLocation Generalized Dimension}).
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public boolean SkipRawData = true;
    public boolean BLOCKTEXTUREANALYSIS=false;
    /**
     * If true, runs 
     * {@link FLAnalyzer.FLMain#measureHullandCircle circularity}
     * calculations. Default
     * is to run them. Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    private boolean docircul = false;
    
    /**
     * True fills coloured squares if 
     * {@link FLAnalyzer.FLMain#runSubs subareas}
     * subareas are being done.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    //private boolean fill=false;
    
    /**
     * Integer sets the colour coding scheme according to
     * the internal ColourRule class in the
     * {@link FLAnalyzer.FLMain#runSubs subsampling} method.
     */
    private int colourcode=16;
    
    /**
     * True checks a random sample of subareas over the image
     * in the {@link FLAnalyzer.FLMain#runSubs subsampling} method.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    private boolean randomsquares=false;
    
    /**
     * True shows a graphic colour coded for the fractal
     * dimension of each {@link FLAnalyzer.FLMain#runSubs subarea}.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public boolean showcolours = false;
    
    /**
     * True if the user wants to set the number of boxes
     * rather than use a value 
     * {@link FLAnalyzer.FLMain#MakeNewBoxSizes optimized}
     * for each image size.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public boolean UserWantsToSpecifyNumberOfBoxes=false;
    /**
     * True if the user wants to set the number of boxes
     * rather than use a value 
     * {@link FLAnalyzer.FLMain#MakeNewBoxSizes optimized}
     * for each image size.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public boolean LacuserNumber=false;
    /**
     * True if the user wants to set the number of boxes
     * rather than use a value 
     * {@link FLAnalyzer.FLMain#MakeNewBoxSizes optimized}
     * for each image size.
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     */
    public boolean MFuserNumber=true;
    
    /**
     * True does an entire image or roi area. 
     * Is set by {@link FLAnalyzer.FLsetup#getInputs}.
     *
     */
    public boolean doglobal=true;
    
    public boolean MF=true;
    private boolean GraphAQ=false,GraphFA=false,GraphFQ=false, GraphT=false,
    GraphRegression=false, GraphLac=false;
    
    public boolean SelectBestCV=true;
    public boolean WriteQslopeandCV=false;
    
    
    
     /**
     * True prints the pixel mass and probability frequency distributions.
     *
     */
    public boolean printFrequencies=false;
    
    /**
     * True enables a random mass sample that accumulates
     * with each scan, rather than terminates as otherwise happens.
     */
    public boolean cumulative = false;
    /**True enables the opening of many files at once.*/
    //private boolean MultiFiles = true;
//    boolean InContour=true;
    
    ///////////////////////////////////////////////////////////////
    ///////////  VARIABLES RETURNED FOR MORPHOMETRICS /////////////
    ///////////////////////////////////////////////////////////////

    

    /**Boolean is initially false, is used for deciding how to process an image in 
     * {@link FLMain#ScanPassedImage FLMain} and
   
     * @link GUI.FL_#copyROInow copy roi}, and 
     * @link GUI.FL_#StartScans StartScans}.*/
    public boolean wasAGrab = false;
    
    /**Boolean is checked before an image or roi is processed. Initialized to false;
     *Is changed in the input getting methods of {@link FLsetup set up method}..*/
   // private boolean proceed = true;
    
    /**If true, a subscan is run using rectangular areas. Is set to false
      automatically in all non subscan calls -- i.e., 
     * {@link FLsetup#getInputs standard inputs}
     * {@link FLsetup#getLacInputs sliding lacunarity},
     *  and {@link FLsetup#getMFInputs multifractal inputs}--
     but is manipulated in{@link FLsetup#GetSubScanInputs subs}.*/
    public boolean UseRectangularAnalyzer = false;
    
    
    
    
    

    
	
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

   
 
   
     
    
     
     
    
    
    
/**Margins[0]=left margin, Margins[1]=right margin, Margins[2]=top margin, Margins[3]=bottom margin*/
    public int [] Margins=null;
     
     public String RawDataString="";
     
     
     
     
     
     
    
     
    
    /////////////////END VARIABLE DECLARATIONS////////////////////////
    //////////////////////////////////////////////////////////////////
    
    //===============================================================//
    
    //////////////////////////////////////////////////////////////////
    /////////////////////          METHODS         ///////////////////
    //////////////////////////////////////////////////////////////////
    /**Constructor that accepts no parameters*/
    public FLVars()
    {
    	/*
    	prepQs();
    	
    	Globalxy=new int[NumberOfGridPositions][2];
        
        for (int i = 0; i < NumberOfGridPositions;i++) {
            Globalxy[i][0]=0;
            Globalxy[i][1]=0;
        }
        */
    	
    	BottomRight=true;
        MF=true;
        SLAC=false;
        
        //DRAWHull=false;
        //DRAWCircle=false;
        setDocircul(false);
        dosubs=false;
        setUseParticleAnalyzer(false);
        UseRectangularAnalyzer=false;
        
		if(ChooseBackground==USEBLACK)
		{ background=BLACK; foreground=WHITE;}
		if(ChooseBackground==USEWHITE)
		{ background=WHITE; foreground=BLACK;}
		
        TypeOfBoxSizeSeries=MFTypeOfBoxSizeSeries;
{ power=false; ScaleTheBoxSizes=false;}
if(TypeOfBoxSizeSeries==SCALEDSERIES)
{ power=false; ScaleTheBoxSizes=true;}
if(TypeOfBoxSizeSeries==POWERSERIES)
{ power=true; ScaleTheBoxSizes=false;}
        
        if(MaximumMFBoxSizes<=0) {
            MaximumMFBoxSizes=0;MFuserNumber=false;} 
        else MFuserNumber=true;
        
        if (MFUserMinBoxSize<=1)MFUserMinBoxSize=1;
        
        if(mfmaxpercent<=1) {
            mfmaxpercent=1;}
        maxpercent=mfmaxpercent;
        
        //MFUseGreater=UseGreater;
        
        if ((getNumberOfGridsForMultiFractalAnalysis() <= 0)) {
            setNumberOfGridsForMultiFractalAnalysis(1);
            doglobal=false;}else doglobal=true;
        NumberOfGridPositions
                =getNumberOfGridsForMultiFractalAnalysis();
        Globalxy=new int[NumberOfGridPositions][2];
        
        for (int i = 0; i < NumberOfGridPositions;i++) {
            Globalxy[i][0]=0;
            Globalxy[i][1]=0;
        }
        
        
        
  
        
        
       
        if (MaxFrequencies<5)MaxFrequencies = 5;
        
        if (getQinc()<0)setQinc(getQinc()*-1.0f);
        
        //Qs=FLsetup.MakeAnArrayOfQs(getQmin(), getQmax(),
        //        getQinc(), getQinc());
        prepQs();
        
       
        
        if(percentsubboxsize<.5f)percentsubboxsize=.5f;
        
        
        if(cumulative) {
            dosubs=true;
            setRandomsquares(true);
            doglobal=false;
            //MultiFiles=false;
            NumberOfGridPositions=1;
            NumberOfGridsForMultiFractalAnalysis=1;
            setQuick(false);
            if (dataoption==0||dataoption==1);
            else dataoption=0;
        }
        
//        SLIDEX=(int)gd.getNextNumber();
//        SLIDEY=(int)gd.getNextNumber();

        if(subsamples<=0) subsamples=1;
       
        
        if (getFACTOR()<=0) setFACTOR(0);
        
        //proceed=true;
    }
    
    
    
    private void prepQs()
    {
    	Qs = new float[84];
    	for(int i = 0; i < 84; ++i)
    		Qs[i] = -10 + (i / 4) + (i % 4) * 0.25f; 
    }

    /**
     * 
     * @return true if the scan is to be {@link #abort aborted} 
     */
    public boolean isAbort() 
    {
        return this.abort;
    }

    /**
     * 
     * @param abort 
     */
    public void setAbort(final boolean abort) 
    {
        this.abort = abort;
    }

     /**
     * 
     * @return an int for the value of {@link #actualx x} the scan started at 
     */
    public int getActualx() 
    {
        return this.actualx;
    }

    /**
     * 
     * @param actualx 
     */
    public void setActualx(final int actualx) 
    {
        this.actualx = actualx;
    }

    /**
     * 
     * @return an int for the value of {@link #actualy y} the scan started at 
     */
    public int getActualy() 
    {
        return this.actualy;
    }

    /**
     * 
     * @param actualy 
     */
    public void setActualy(final int actualy) 
    {
        this.actualy = actualy;
    }

    /**
     * 
     * @return int for background (255 or 0)
     */
    public int getBackground() 
    {
        return this.background;
    }

    /**
     * 
     * @param background 
     */
    public void setBackground(final int background) 
    {
        this.background = background;
    }

   

    /**
     * 
     * @return an int for the {@link #colourcode} 
     */
    public int getColourcode() 
    {
        return this.colourcode;
    }

    /**
     * 
     * @param colourcode 
     */
    public void setColourcode(final int colourcode) 
    {
        this.colourcode = colourcode;
    }

    /**
     * 
     * @return an integer for the {@link #comptype composite type} 
     */
    public int getComptype() 
    {
        return this.comptype;
    }

    /**
     * 
     * @param comptype 
     */
    public void setComptype(final int comptype) 
    {
        this.comptype = comptype;
    }

    /**
     * 
     * @return true if {@link #docircul} circularity is being calculated
     */
    public boolean isDocircul() 
    {
        return this.docircul;
    }

    /**
     * 
     * @param docircul 
     */
    public void setDocircul(final boolean docircul) 
    {
        this.docircul = docircul;
    }

    

    /**
     * 
     * @return a float for {@link #FACTOR}
     */
    public float getFACTOR() 
    {
        return this.FACTOR;
    }

    /**
     * 
     * @param FACTOR 
     */
    public void setFACTOR(final float FACTOR) 
    {
        this.FACTOR = FACTOR;
    }

 

    /**
     * 
     * @param fill 
     */
    public void setFill(final boolean fill) 
    {
        //this.fill = fill;
    }

    /**
     * 
     * @return an integer for foreground (either 0 or 255)
     */
    public int getForeground() 
    {
        return this.foreground;
    }

    /**
     * 
     * @param foreground 
     */
    public void setForeground(final int foreground) 
    {
        this.foreground = foreground;
    }

    /**
     * 
     * @return true if graphing &alpha; vs. Q 
     */
    public boolean isGraphAQ() 
    {
        return this.GraphAQ;
    }

    /**
     * 
     * @param GraphAQ 
     */
    public void setGraphAQ(final boolean GraphAQ) 
    {
        this.GraphAQ = GraphAQ;
    }

    /**
     * 
     * @return true if graping f(&alpha;) vs. &alpha; 
     */
    public boolean isGraphFA() 
    {
        return this.GraphFA;
    }

    /**
     * 
     * @param GraphFA 
     */
    public void setGraphFA(final boolean GraphFA) 
    {
        this.GraphFA = GraphFA;
    }

    /**
     * 
     * @return true if graphing f(&alpha;) vs Q 
     */
    public boolean isGraphFQ() 
    {
        return this.GraphFQ;
    }

    /**
     * 
     * @param GraphFQ 
     */
    public void setGraphFQ(final boolean GraphFQ) 
    {
        this.GraphFQ = GraphFQ;
    }

    /**
     * 
     * @return true if graphing any sliding box lacunarity graphs
     */
    public boolean isGraphLac() 
    {
        return this.GraphLac;
    }

    /**
     * 
     * @param GraphLac 
     */
    public void setGraphLac(final boolean GraphLac) 
    {
        this.GraphLac = GraphLac;
    }

    /**
     * 
     * @return true if graphing any multifractal graphs
     */
    public boolean isGraphQs() 
    {
        return this.GraphQs;
    }

    /**
     * 
     * @param GraphQs 
     */
    public void setGraphQs(final boolean GraphQs) 
    {
        this.GraphQs = GraphQs;
    }

    /**
     * 
     * @return true if graphing regression lines
     */
    public boolean isGraphRegression() 
    {
        return this.GraphRegression;
    }

    /**
     * 
     * @param GraphRegression 
     */
    public void setGraphRegression(final boolean GraphRegression) 
    {
        this.GraphRegression = GraphRegression;
    }

    /**
     * 
     * @return true if Graphing Tau 
     */
    public boolean isGraphT() 
    {
        return this.GraphT;
    }

    /**
     * 
     * @param GraphT 
     */
    public void setGraphT(final boolean GraphT) 
    {
        this.GraphT = GraphT;
    }

    /**
     * 
     * @return int for the number of {@link #NumberOfGridsForMultiFractalAnalysis grid positions} to use
     */
    public int getNumberOfGridsForMultiFractalAnalysis() 
    {
        return this.NumberOfGridsForMultiFractalAnalysis;
    }

    /**
     * 
     * @param MFgrids 
     */
    public void setNumberOfGridsForMultiFractalAnalysis(final int MFgrids) 
    {
        this.NumberOfGridsForMultiFractalAnalysis = MFgrids;
    }

    /**
     * 
     * @return true if this is a multifractal scan
     */
    public boolean isMF() 
    {
        return this.MF;
    }

    /**
     * 
     * @param mf 
     */
    public void setMF(final boolean mf) 
    {
        this.MF = mf;
    }

    /**
     * 
     * @return float for the increment between q values
     *@see #qinc
     */
    public float getQinc() 
    {
        return this.qinc;
    }

    /**
     * 
     * @param qinc 
     */
    public void setQinc(final float qinc) 
    {
        this.qinc = qinc;
    }

    /**
     * 
     * @return float for the maximum {@link #qmax q} value
     */
    public float getQmax() 
    {
        return this.qmax;
    }

    /**
     * 
     * @param qmax 
     */
    public void setQmax(final float qmax) 
    {
        this.qmax = qmax;
    }
    private static String tab = "\t";
 /**
     * Returns the passed array of strings as a single 
     * string separated by ,s.
     * Is used to list the headings for the results file as a string. Is called in the
     *     {@link GUI.FL_#run} method of {@link GUI.FL_}</p>
     * @return string of headings.
     */
    private static String MakeHeadings (String [] arrayofheadings)
    {
        String headings ="";
        
        
    
        
        {  
            headings=arrayofheadings[0];
            for (int i = 1; i<arrayofheadings.length;i++)
            headings=headings+tab+arrayofheadings[i];
            
        }      
              
        return headings;
        
    }
    /**
     * 
     * @return float for the {@link #qmin minimum q value}
     */
    public float getQmin() 
    {
        return this.qmin;
    } 
 
    /**
     * 
     * @param qmin 
     */
    public void setQmin(final float qmin) 
    {
        this.qmin = qmin;
    } 

    /**
     * 
     * @return true if quick scans are being done
     */
    public boolean isQuick() 
    {
        return this.quick;
    }

    /**
     * 
     * @param quick 
     */
    public void setQuick(final boolean quick) 
    {
        this.quick = quick;
    }

    /**
     * 
     * @return true if the random squares method is being used
     */
    public boolean isRandomsquares() 
    {
        return this.randomsquares;
    }

    /**
     * 
     * @param randomsquares 
     */
    public void setRandomsquares(final boolean randomsquares) 
    {
        this.randomsquares = randomsquares;
    }

    /**
     * 
     * @return true if the particleanalyzer is being used 
     */
    public boolean isUseParticleAnalyzer() 
    {
        return this.UseParticleAnalyzer;
    }

    /**
     * 
     * @param UseParticleAnalyzer 
     */
    public void setUseParticleAnalyzer(final boolean UseParticleAnalyzer) 
    {
        this.UseParticleAnalyzer = UseParticleAnalyzer;
    }
    
       
    public boolean GraphAnyQs() {
        if (isGraphQs()||isGraphAQ()||isGraphFA()||isGraphFQ()||isGraphT())
            return true;
        else return false;
    }

    
}/*end plugin*/
